package o;

import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class ezh {
    private String ˊ;
    private String ˋ;
    private String ˎ;
    private String ˏ;
    private String ॱ;

    public ezh(GameInfo gameInfo, String str) {
        if (gameInfo != null) {
            this.ॱ = gameInfo.getCpId();
            this.ˏ = gameInfo.getSdkVersionCode();
            this.ˋ = gameInfo.getSdkVersionName();
            Map ˋ = baa.ˋ(str);
            if (ˋ == null || !(ˋ.containsKey("packageName") || ˋ.containsKey("appId"))) {
                this.ˎ = gameInfo.getAppId();
                this.ˊ = gameInfo.getPackageName();
            }
        }
    }

    public void ॱ(Map<String, String> map) {
        Logger.ˏ("WebViewParams", "addBuoyPostData");
        if (map != null) {
            ॱ(map, "sdkVersionCode", this.ˏ);
            ॱ(map, "sdkVersionName", this.ˋ);
            ॱ(map, "cpId", this.ॱ);
            ॱ(map, "serviceType", String.valueOf(4));
            if (!(map.containsKey("appId") || map.containsKey("packageName"))) {
                ॱ(map, "appId", this.ˎ);
                ॱ(map, "packageName", this.ˊ);
            }
            ˋ(map);
        }
    }

    private void ॱ(Map<String, String> map, String str, String str2) {
        if (str2 != null) {
            map.put(str, str2);
        }
    }

    private void ˋ(Map<String, String> map) {
        Set<Entry> entrySet = map.entrySet();
        if (entrySet != null && entrySet.size() > 0) {
            for (Entry entry : entrySet) {
                String str = (String) entry.getValue();
                if (str != null) {
                    entry.setValue(dof.ˏ(str));
                }
            }
        }
    }
}
